package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appmarket.service.store.awk.card.BannerCard;
import com.huawei.appmarket.service.store.awk.card.BannerCard.BannerPagerAdapter;
import java.util.ArrayList;
import o.cdr;
import o.chy;
import o.chz;
import o.cih;
import o.eje;
import o.epv;
import o.ewm.d;
import o.ewm.e;
import o.ewm.h;

public class SubCatBannerNode extends cdr {
    private BannerPagerAdapter ˊ = null;
    private eje ॱॱ = new eje(this) {
        final /* synthetic */ SubCatBannerNode ˏ;

        {
            this.ˏ = r1;
        }

        public long ˎ() {
            return this.ˏ.ˏ;
        }
    };

    public SubCatBannerNode(Context context) {
        super(context, 1);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        viewGroup.setPadding(0, 0, 0, 0);
        View inflate = LayoutInflater.from(this.ॱ).inflate(h.ˋʻ, null);
        cih bannerCard = new BannerCard(this.ॱ);
        bannerCard.ˎ(this.ॱॱ);
        bannerCard.getClass();
        this.ˊ = new BannerPagerAdapter();
        ˊ(bannerCard);
        bannerCard.ˏ(false);
        bannerCard.ˏ(inflate);
        viewGroup.addView(inflate);
        return true;
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        this.ˏ = o_chz.ˏ;
        BannerCard bannerCard = (BannerCard) ˊ(0);
        if (bannerCard == null || this.ˊ == null) {
            return false;
        }
        bannerCard.ˎ();
        int ˋ = o_chz.ˋ();
        if (ˋ > 0) {
            this.ˊ.clear();
        }
        for (int i = 0; i < ˋ; i++) {
            BaseCardBean baseCardBean = (BaseCardBean) o_chz.ˋ(i);
            if (baseCardBean != null) {
                this.ˊ.add(baseCardBean);
                if (o_chz.ˋ() != 1) {
                    ˏ(bannerCard, i, o_chz.ˋ());
                }
            }
        }
        bannerCard.ˏ(this.ˊ);
        this.ˊ.notifyBannerCycle();
        return true;
    }

    public void ˏ(BannerCard bannerCard, int i, int i2) {
        ImageView imageView = new ImageView(this.ॱ);
        int ˋ = epv.ˋ(this.ॱ, 5);
        LayoutParams layoutParams = new LinearLayout.LayoutParams(ˋ, ˋ);
        imageView.setImageDrawable(this.ॱ.getResources().getDrawable(e.ʻॱ));
        if (i < i2) {
            layoutParams.rightMargin = (int) this.ॱ.getResources().getDimension(d.ˍ);
        }
        imageView.setLayoutParams(layoutParams);
        bannerCard.ॱ(imageView);
    }

    public void ˋ(chy o_chy) {
        ((BannerCard) ˊ(0)).ˊ(o_chy);
    }

    public ArrayList<String> z_() {
        BannerCard bannerCard = (BannerCard) ˊ(0);
        if (bannerCard != null) {
            return bannerCard.ˊ(this.ˊ);
        }
        return null;
    }

    public boolean ॱ() {
        return true;
    }
}
